function R = clique_features(image)
if size(image,3) == 3
    image = rgb2gray(image);
end
image = double(image);
f_a = processOne(image, [2 -1;-1 0]);
f_b = processOne(image, [0 -1;-1 2]);
f_c = processOne(image, [-1 0;2 -1]);
f_d = processOne(image, [-1 2;0 -1]);
f_e = processOne(image, [0 1;-1 -1;0 1]);
f_f = processOne(image, [0 -1 0;1 -1 1]);
f_g = processOne(image, [1 -1 1;0 -1 0]);
f_h = processOne(image, [1 0;-1 -1;1 0]);
f_i = processOne(image, [0 0 0 -1 2 -1 0 0 0;0 1 -2 3 -4 3 -2 1 0;0 -2 4 -3 2 -3 4 -2 0; ...
    -1 3 -3 1 0 1 -3 3 -1;2 -4 2 0 0 0 2 -4 2]);
f_j = processOne(image, [2 -4 2 0 0 0 2 -4 2;-1 3 -3 1 0 1 -3 3 -1;...
    0 -2 4 -3 2 -3 4 -2 0;0 1 -2 3 -4 3 -2 1 0;0 0 0 -1 2 -1 0 0 0]);
f_k = processOne(image, [0 0 0 -1 2;0 1 -2 3 -4;0 -2 4 -3 2;-1 3 -3 1 0;2 -4 2 0 0;...
    -1 3 -3 1 0;0 -2 4 -3 2;0 1 -2 3 -4;0 0 0 -1 2]);
f_l = processOne(image, [2 -1 0 0 0;-4 3 -2 1 0;2 -3 4 -2 0;0 1 -3 3 -1;0 0 2 -4 2;...
    0 1 -3 3 -1;2 -3 4 -2 0;-4 3 -2 1 0;2 -1 0 0 0]);
R = [f_a f_b f_c f_d f_e f_f f_g f_h f_i f_j f_k f_l];
end

function f = processOne(image, filter)
%if sum(filter(:)) ~= 0
%    error('wrong value?');
%end
r = filter2(filter, image) - image;
f = lpq(r, 3, 0, 1, 'nh');
end
